<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ include file="/includes/taglibs.jsp"%>
<%@ taglib uri="/WEB-INF/extremecomponents.tld" prefix="ec"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学生列表</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/common.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/extremecomponents.css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.4.2.min.js"></script>
<style type="text/css">
	.eXtremeTable .tableHeader {
	height: 26px; 
	line-height:25px;
	background:url(/images/platform/tr.jpg) repeat;
	color: #000;
	font-weight: bold;
	border: 0px solid #CCC;
	background-image: url("/images/platform/tr1.jpg") no-repeat;
	background-position: top right;
	white-space: nowrap;
	overflow: hidden;
}
</style>
<script type="text/javascript">
	function loadInstitute(){
		var action = "listInstitueJson.action";
		$("#instituteId").find("option").remove();
		$("#instituteId").append('<option value="">---请选择学院---</option>');
		var institudeId = "${score.student.clazz.department.institute.id}";
		$.getJSON(action,function(data){
			var json = eval(data);
			$.each(json,function(i,n){
				if(institudeId == json[i].id){
					$("#instituteId").append('<option selected value='+json[i].id+'>'+json[i].name+'</option>');
				}else{
					$("#instituteId").append('<option value='+json[i].id+'>'+json[i].name+'</option>');
				}
			}) 
		});
		if(institudeId!=""){
			selDepartment();
		}
	}
	function selDepartment(){
		var departmentId = "${score.student.clazz.department.id}";
		var id = "${score.student.clazz.department.institute.id}";
		if(id == ""){
			id = $("#instituteId").val();		
		}
		$("#departmentId").find("option").remove();
		$("#departmentId").append('<option value="">---请选择专业---</option>');
		var action = "listDepartmentJson.action?institute.id="+id;
		$.getJSON(action,function(data){
			var json = eval(data);
			$.each(json,function(i,n){
				if(departmentId==json[i].id){
					$("#departmentId").append('<option selected value='+json[i].id+'>'+json[i].name+'</option>');
				}else{
					$("#departmentId").append('<option value='+json[i].id+'>'+json[i].name+'</option>');
				}
			})
		})
		if(departmentId!=""){
			selClass();
		}
	}
	
	function selClass(){
		var clazzId = "${score.student.clazz.id}";
		var id = "${score.student.clazz.department.id}";
		if(id == ""){
			id = $("#departmentId").val();			
		}
		$("#clazz").find("option").remove();
		$("#clazz").append('<option value="">---请选择班级---</option>');
		var action = "listClazzJson.action?department.id="+id;
		$.getJSON(action,function(data){
			var json = eval(data);
			$.each(json,function(i,n){
				if(clazzId==json[i].id){
					$("#clazz").append('<option selected value='+json[i].id+'>'+json[i].name+'</option>');
				}else{
					$("#clazz").append('<option value='+json[i].id+'>'+json[i].name+'</option>');
				}
			})
		})
	}
</script>
</head>
	<body onload="loadInstitute();">
		<div id="man_zone">
		<form action="scoreRank.action" method="post" id="form1" >
		 <table class="table_style" border="0" align="center"  cellpadding="3" cellspacing="1" width="1000px">
		      <tr>
			   		<td class="left_title_1">班级:</td>
			   		<td colspan="3">
					学院：<select id="instituteId" name = "score.student.clazz.department.institute.id" onchange="selDepartment();">
							<option>---请选择学院---</option>
						</select>
					专业：<select id="departmentId" name="score.student.clazz.department.id" onchange="selClass();">
							<option>---请选择系---</option>
						</select>
					班级：<select id="clazz" name="score.student.clazz.id">
							<option>---请选择班级---</option>
						</select>
			   		</td>
			   		
		   	 </tr>
		      
		      <tr>
		        <td class="left_title_1">学期:</td>
		        <td>
		          <select id="scoreyear" name="scoreyear">
		           <option value="">--请选择学年--</option>
		           <option value="2011年">2011年</option>
		           <option value="2012年">2012年</option>
		           <option value="2013年">2013年</option>
		          </select>
		         学期
		          <select id="scoreterm" name="scoreterm">
		           <option value="">--请选择学期--</option>
		           <option value="第一学期">第一学期</option>
		           <option value="第二学期">第二学期</option>
		          </select>
		        <input type="submit" value="查询"/> 
		        </td>
		      </tr>
		     
		 </table>
		</form>
		 <table class="table_style" border="0" align="center"  cellpadding="3" cellspacing="1" width="950px">
		   	<tr>
		   		<td class="left_title_1" >排名</td>
		   	    <td class="left_title_1" >学号</td>
		   	    <td class="left_title_1" >姓名</td>
		   		<td class="left_title_1">绩点</td>
		   		<td class="left_title_1">学期</td>
		   	</tr>
		   	<s:iterator value="stats" status="st" id="stat">
		   		<tr>
		   		<td class="left_title_2">${st.index+1}</td>
		   		<td class="left_title_2">${stuNo}</td>
		   		<td class="left_title_2">${stuName}</td>
		   		<td class="left_title_2">${conPoint}</td>
		   		<td class="left_title_2">${term}</td>
		   		</tr>
		   	</s:iterator>
		   	<tr>
		   		
		   	</tr>
		</table>
		</div>
		
	</body>
</html>